home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / lu62 / port / smsgop.h < prev    next >
Text File  |  1996-07-10  |  4KB  |  116 lines

  1. /* k 0165    25/05/91    */
  2. /* k 0175     09/06/91    */
  3. /* k 0191    02/07/91    */
  4. /* k 0206    06/09/91    */
  5. /* k 0218    16/09/91    *//* printf if no VT */
  6. /* k 0224       23/09/91        *//* ebss */
  7. /* k 0226    24/09/91    *//* literals */
  8. /* k 0232    11/10/91    */
  9. /* k 0258    10/11/91    *//* 1 to -1 */
  10. /* k 0304    23/02/92    *//*    path     */
  11. #include <ebss.h>               /* @0224 */
  12. #include <fcntl.h>        /* @0218 */
  13. #if (OVL_TYPE!=1)
  14. #include <stdio.h>        /* @0218 */
  15. #endif
  16. #include <pconio.h>
  17. extern char wbuf[];                             /* @0230 */
  18. extern char *msg1;    /* @0206 */             /* @0230 */
  19. extern char *mname;    /* @0206 *//* @0208 */  /* @0230 */
  20. extern char *p_msg;    /* @0230 */
  21. smsgop(mno,pno,a)        /* @0191 */
  22. short mno;            /* @0191 */
  23. short pno;            /* @0191 */
  24. short *a[];            /* @0191 */
  25. {
  26. char *s0,*s1;
  27. short i;
  28. short mfd;        /* @0206 */
  29. #if ((OVL_TYPE==1)&&(RESIDENT!=1))      /* @0304 */
  30.  Res_strcpy(portpath+1+portpath[0],mname);    /* @0304 */
  31. #else                                           /* @0304 */
  32.  strcpy(portpath+1+portpath[0],mname);    /* @0304 */
  33. #endif                                  /* @0304 */
  34. #if ((OVL_TYPE==1)&&(RESIDENT!=1))
  35.  if ((mfd=Res_open(portpath+1,O_BINARY|0))==-1)/* @0206  @0218 @0230 @0304 */
  36.   {            /* @0206 */
  37.    pcprintf(msg1);    /* @0206 *//* @0230 *//* @0233 */
  38.    return;        /* @0206 */
  39.   }            /* @0206 */
  40.  if (Res_lseek(mfd,(long)(2*(mno-1)),0)!=-1)    /* @0175 *//* @0258 */
  41.    if (Res_read(mfd,&offs,2)>0)        /* @0175 */
  42.     if (offs!=0)
  43.      if (Res_lseek(mfd,(long)offs,0)!=-1)    /* @0175 */
  44.        {
  45.      Res_read(mfd,wbuf+160,70);        /* @0175 @0206 @0230 */
  46. #else
  47.  if ((mfd=open(portpath+1,O_BINARY|0))==-1)/* @0206  @0218 @0230 *//* @0304 */
  48.   {            /* @0206 */
  49.    printf(msg1);    /* @0206 *//* @0230 */
  50.    return;        /* @0206 */
  51.   }            /* @0206 */
  52.  if (lseek(mfd,(long)(2*(mno-1)),0)!=1)    /* @0175 */
  53.    if (read(mfd,&offs,2)>0)        /* @0175 */
  54.     if (offs!=0)
  55.      if (lseek(mfd,(long)offs,0)!=-1)    /* @0175 */
  56.        {
  57.      read(mfd,wbuf+160,70);        /* @0175 *//* @0206 */
  58. #endif
  59.      i=0;
  60.      while (wbuf[i+160]!=0x0a)    /* @0175 @0206 *//* @0230 */
  61.        i++;
  62. /*     setcursor(NOCURSOR);*/        /* @0258 *//* @0308 */
  63.      if (vt_flag & VT_ACT)        /* @0218 */
  64.      {                /* @0218 */
  65.      setcursor(NOCURSOR);        /* @0258 */
  66.      wbuf[i+160]=0x00;        /* @0175 *//* @0206 *//* @0230 */
  67. #if (OS_TYPE==0)            /* @0191 */
  68.      pcprintf(p_msg,mno);            /* @0226 *//* @0230 */
  69. #elif (OS_TYPE==3)            /* @0191 */
  70.          pcprintf("PORT-M MSG %u: ",mno);    /* @0191 */
  71. #else                    /* @0191 */
  72.          pcprintf("PORT-X MSG %u: ",mno);    /* @0191 */
  73. #endif                    /* @0191 */
  74. /*     if (pno==0)   */
  75.        pcprintf(wbuf+160);        /* @0206 */
  76. /*     else
  77.       {
  78.        s0=wbuf+160;        /* @0206 */
  79.        for (i=0;i<70;i++)
  80.          if (wbuf[i+160]=='%')        /* @0206 *//* @0230 */
  81.            break;
  82.        if (i<70)
  83.          s1=s0+i;
  84.        for (i=0;i<pno;i++)
  85.         {
  86.         }
  87.       }          */
  88.      }        /* @0218 */
  89.      else        /* @0218 */
  90.      {        /* @0218 */
  91.      wbuf[i+161]=0x00;        /* @0175 *//* @0206 *//* @0230 */
  92. #if (OS_TYPE==0)            /* @0191 *//* @0218 */
  93. #if ((OVL_TYPE==1)&&(RESIDENT!=1))
  94.      Res_printf(p_msg,mno);          /* @0218 *//* @0226 *//* @0230 */
  95. #else
  96.      printf(p_msg,mno);          /* @0218 *//* @0226 *//* @230 */
  97. #endif
  98. #elif (OS_TYPE==3)            /* @0191 *//* @0218 */
  99.      printf("PORT-M MSG %u: ",mno);    /* @0191 *//* @0218 */
  100. #else                    /* @0191 *//* @0218 */
  101.      printf("PORT-X MSG %u: ",mno);    /* @0191 *//* @0218 */
  102. #endif                    /* @0191 *//* @0218 */
  103. #if ((OVL_TYPE==1)&&(RESIDENT!=1))
  104.      Res_printf(wbuf+160);    /* @0206 *//* @0218 *//* @0230 */
  105. #else
  106.      printf(wbuf+160);        /* @0206 *//* @0218 *//* @0230 */
  107. #endif
  108.      }                       /* @0218 */
  109.     }
  110. #if ((OVL_TYPE==1)&&(RESIDENT!=1))
  111.     Res_close(mfd);        /* @0206 */
  112. #else
  113.     close(mfd);        /* @0206 */
  114. #endif
  115. }
  116.